package com.itheima.mall.service.pmsService;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.dto.pms.PmsProductDto;
import com.itheima.pojo.pms.*;
import com.itheima.vo.pms.PmsProductVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PmsProductService {

    @DubboReference
    private PmsProductApi pmsProductApi;

    //查询商品
    public Page<PmsProduct> list(Integer brandId, String keyword, Integer pageNum, Integer pageSize, Integer productCategoryId, String productSn, Integer publishStatus, Integer verifyStatus) {
        return pmsProductApi.list(brandId, keyword, pageNum, pageSize, productCategoryId, productSn, publishStatus, verifyStatus);
    }

    //根据商品名称或货号模糊查询
    public List<PmsProduct> simpleList(String keyword) {
        return pmsProductApi.simpleList(keyword);
    }

    //批量修改删除状态
    public void deleteStatus(List<Integer> ids, Integer deleteStatus) {
        pmsProductApi.deleteStatus(ids, deleteStatus);
    }

    //批量设为新品
    public void newStatus(List<Integer> ids, Integer newStatus) {
        pmsProductApi.newStatus(ids, newStatus);
    }

    //批量上下架商品
    public void publishStatus(List<Integer> ids, Integer publishStatus) {
        pmsProductApi.publishStatus(ids, publishStatus);
    }

    //批量推荐商品
    public void recommendStatus(List<Integer> ids, Integer recommendStatus) {
        pmsProductApi.recommendStatus(ids, recommendStatus);
    }

    //批量修改审核状态
    public void verifyStatus(List<Integer> ids, String detail, Integer verifyStatus) {
        pmsProductApi.verifyStatus(ids, detail, verifyStatus);
    }

    //创建商品

    public void create(PmsProductDto pmsProductDto) {

    }

    //更新商品
    public void update(Integer id, PmsProductDto pmsProductDto) {

    }

    //根据商品id获取商品编辑信息
    public PmsProductVo updateInfo(Integer id) {

        return null;
    }
}
